package gui.components.JXTable.JXRow;

import java.awt.*;

/**
 * Date: 06.09.2005
 * Time: 11:00:54
 */
public class JXRowHeader implements iJXRowHeader{

    private JXRowSet rowSet = null;
    private Integer pos = null;
    private JXRowHeaderRenderer headerRenderer;

    public JXRowHeader(JXRowSet rowSet, Integer pos){
        this.rowSet = rowSet;
        this.pos = pos;
        this.headerRenderer = rowSet.getHeaderRenderer();
    }

    public void setRowHeaderText(String s) {
        this.rowSet.getRowHeaderText().removeElementAt(pos);
        this.rowSet.getRowHeaderText().add(pos,s);
    }

    public void markRowHeaderOn(Color color) {
        headerRenderer.addColorHeaderRow(pos,color);
    }

    public void markRowHeaderOff() {
        headerRenderer.removeColorHeaderRow(pos);
    }
}
